class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.x: C = None
        self.y: C = None
        self.v: C = None
        self.z: F = None
        self.t: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.p: A = None
        self.q: D = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.p: A = None
        self.q: D = None
        self.txt = txt

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

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

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

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