class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: C = None
        self.v: E = None
        self.q: B = None
        self.txt = txt

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

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

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

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

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

f = A("f")
d = B("d")
g = C("g")
n = D("n")
c = E("c")
h = F("h")

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

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

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

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

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

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

f = A("f")
d = B("d")
g = C("g")
n = D("n")
c = E("c")
h = F("h")

f.u = g
f.t = g
f.v = c
f.q = d
d.y = f
g.z = h
g.x = d
n.t = d
n.y = h
n.o = c
n.x = c
n.s = g
c.u = n
h.t = c
h.r = c
h.x = d
h.q = n
assert f.v.u.y.q.s.z.txt == "h"