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

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

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

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.s: F = None
        self.w: F = None
        self.u: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.z: G = None
        self.s: B = None
        self.v: G = None
        self.u: D = None
        self.y: D = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.s: F = None
        self.w: F = None
        self.u: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.z: G = None
        self.s: B = None
        self.v: G = None
        self.u: D = None
        self.y: D = None
        self.txt = txt

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

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

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