class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.u: D = None
        self.s: B = None
        self.p: F = None
        self.q: C = None
        self.txt = txt

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

g = A("g")
h = B("h")
b = C("b")
m = D("m")
d = E("d")
f = F("f")
a = B("a")

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

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

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.u: D = None
        self.s: B = None
        self.p: F = None
        self.q: C = None
        self.txt = txt

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

g = A("g")
h = B("h")
b = C("b")
m = D("m")
d = E("d")
f = F("f")
a = B("a")

g.q = b
h.s = a
h.v = a
h.o = m
b.z = d
m.o = b
d.t = a
d.u = m
d.s = h
d.p = f
d.q = b
f.y = m
f.v = m
f.u = m
f.o = a
f.x = b
f.q = d
a.s = h
a.v = h
a.o = m
assert f.u.o.z.s.txt == "h"