class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.p: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.t: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.u: B = None
        self.x: B = None
        self.o: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: H = None
        self.z: C = None
        self.r: B = None
        self.v: F = None
        self.s: G = None
        self.y: C = None
        self.p: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: C = None
        self.x: E = None
        self.z: H = None
        self.o: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: C = None
        self.w: G = None
        self.t: B = None
        self.txt = txt

f = A("f")
l = B("l")
d = C("d")
k = D("k")
n = E("n")
j = F("j")
i = G("i")
a = H("a")
g = B("g")
m = B("m")

f.t = k
f.p = j
l.y = d
l.t = d
d.v = j
d.u = g
d.x = m
d.o = f
k.o = a
k.z = d
k.y = d
k.r = g
k.v = j
k.s = i
k.p = n
n.t = j
j.p = n
j.x = n
j.s = d
j.z = a
j.o = k
i.r = l
a.x = d
a.w = i
a.t = g
g.y = d
g.t = d
m.y = d
m.t = d
assert a.w.r.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.p: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.t: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.u: B = None
        self.x: B = None
        self.o: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: H = None
        self.z: C = None
        self.r: B = None
        self.v: F = None
        self.s: G = None
        self.y: C = None
        self.p: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: C = None
        self.x: E = None
        self.z: H = None
        self.o: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: C = None
        self.w: G = None
        self.t: B = None
        self.txt = txt

f = A("f")
l = B("l")
d = C("d")
k = D("k")
n = E("n")
j = F("j")
i = G("i")
a = H("a")
g = B("g")
m = B("m")

f.t = k
f.p = j
l.y = d
l.t = d
d.v = j
d.u = g
d.x = m
d.o = f
k.o = a
k.z = d
k.y = d
k.r = g
k.v = j
k.s = i
k.p = n
n.t = j
j.p = n
j.x = n
j.s = d
j.z = a
j.o = k
i.r = l
a.x = d
a.w = i
a.t = g
g.y = d
g.t = d
m.y = d
m.t = d
assert a.w.r.t.txt == "d"