class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.r: A = None
        self.z: B = None
        self.w: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: G = None
        self.x: H = None
        self.r: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.r: E = None
        self.w: E = None
        self.p: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.q: C = None
        self.t: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.v: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: H = None
        self.w: D = None
        self.txt = txt

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

f = A("f")
b = B("b")
m = C("m")
d = D("d")
j = E("j")
i = F("i")
c = G("c")
e = H("e")
k = H("k")
a = A("a")

f.x = d
f.r = a
f.z = b
f.w = m
b.p = m
b.u = c
b.x = k
b.r = a
m.v = b
m.r = j
m.w = j
m.p = d
d.u = m
d.q = m
d.t = c
j.t = f
i.s = m
i.v = d
c.z = e
c.w = d
e.o = c
e.w = b
e.s = m
k.o = c
k.w = b
k.s = m
a.x = d
a.r = f
a.z = b
a.w = m
assert d.t.w.u.v.u.w.t.z.w.txt == "
class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.r: A = None
        self.z: B = None
        self.w: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: G = None
        self.x: H = None
        self.r: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.r: E = None
        self.w: E = None
        self.p: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.q: C = None
        self.t: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.v: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: H = None
        self.w: D = None
        self.txt = txt

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

f = A("f")
b = B("b")
m = C("m")
d = D("d")
j = E("j")
i = F("i")
c = G("c")
e = H("e")
k = H("k")
a = A("a")

f.x = d
f.r = a
f.z = b
f.w = m
b.p = m
b.u = c
b.x = k
b.r = a
m.v = b
m.r = j
m.w = j
m.p = d
d.u = m
d.q = m
d.t = c
j.t = f
i.s = m
i.v = d
c.z = e
c.w = d
e.o = c
e.w = b
e.s = m
k.o = c
k.w = b
k.s = m
a.x = d
a.r = f
a.z = b
a.w = m
assert d.t.w.u.v.u.w.t.z.w.txt == "b"