class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.s: F = None
        self.z: D = None
        self.t: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.z: E = None
        self.y: B = None
        self.s: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.u: B = None
        self.t: D = None
        self.x: B = None
        self.w: F = None
        self.s: D = None
        self.txt = txt

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

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

g.o = f
g.s = d
g.z = b
g.t = h
h.u = g
k.u = f
k.q = h
k.s = b
b.w = d
b.z = f
b.y = h
b.s = k
f.r = h
f.u = h
f.x = h
f.t = b
f.s = b
f.w = d
d.t = f
d.v = h
assert f.t.w.v.u.txt == "
class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.s: F = None
        self.z: D = None
        self.t: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.z: E = None
        self.y: B = None
        self.s: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.u: B = None
        self.t: D = None
        self.x: B = None
        self.w: F = None
        self.s: D = None
        self.txt = txt

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

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

g.o = f
g.s = d
g.z = b
g.t = h
h.u = g
k.u = f
k.q = h
k.s = b
b.w = d
b.z = f
b.y = h
b.s = k
f.r = h
f.u = h
f.x = h
f.t = b
f.s = b
f.w = d
d.t = f
d.v = h
assert f.t.w.v.u.txt == "g"