class A:
    def __init__(self, txt: str):
        self.t: H = None
        self.v: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: H = None
        self.o: H = None
        self.t: H = None
        self.z: B = None
        self.v: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.t: A = None
        self.r: A = None
        self.z: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: E = None
        self.y: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: G = None
        self.o: F = None
        self.q: D = None
        self.u: C = None
        self.p: C = None
        self.w: D = None
        self.txt = txt

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

l.t = m
l.v = d
d.q = c
a.x = k
a.v = c
e.u = m
e.o = m
e.t = m
e.z = d
e.v = f
f.y = d
f.r = e
f.z = k
c.q = a
c.t = l
c.r = l
c.z = m
k.u = e
k.p = f
k.y = a
m.x = k
m.o = c
m.q = e
m.w = e
m.u = a
m.p = a
assert f.r.o.w.txt == "
class A:
    def __init__(self, txt: str):
        self.t: H = None
        self.v: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: H = None
        self.o: H = None
        self.t: H = None
        self.z: B = None
        self.v: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.t: A = None
        self.r: A = None
        self.z: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: E = None
        self.y: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: G = None
        self.o: F = None
        self.q: D = None
        self.u: C = None
        self.p: C = None
        self.w: D = None
        self.txt = txt

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

l.t = m
l.v = d
d.q = c
a.x = k
a.v = c
e.u = m
e.o = m
e.t = m
e.z = d
e.v = f
f.y = d
f.r = e
f.z = k
c.q = a
c.t = l
c.r = l
c.z = m
k.u = e
k.p = f
k.y = a
m.x = k
m.o = c
m.q = e
m.w = e
m.u = a
m.p = a
assert f.r.o.w.txt == "e"