class A:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.r: F = None
        self.w: F = None
        self.x: D = None
        self.y: G = None
        self.u: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.q: B = None
        self.v: B = None
        self.w: F = None
        self.s: F = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.u: D = None
        self.x: E = None
        self.z: C = None
        self.w: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: C = None
        self.w: D = None
        self.q: E = None
        self.u: E = None
        self.v: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.r: F = None
        self.w: F = None
        self.x: D = None
        self.y: G = None
        self.u: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.q: B = None
        self.v: B = None
        self.w: F = None
        self.s: F = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.u: D = None
        self.x: E = None
        self.z: C = None
        self.w: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: C = None
        self.w: D = None
        self.q: E = None
        self.u: E = None
        self.v: B = None
        self.txt = txt

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

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