class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: F = None
        self.t: H = None
        self.r: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.s: A = None
        self.x: E = None
        self.q: A = None
        self.w: E = None
        self.v: H = None
        self.z: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.w: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.y: A = None
        self.p: D = None
        self.s: G = None
        self.r: B = None
        self.u: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.s: F = None
        self.txt = txt

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

k = A("k")
a = B("a")
m = C("m")
n = D("n")
f = E("f")
g = F("g")
d = G("d")
b = H("b")
l = F("l")

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

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.s: A = None
        self.x: E = None
        self.q: A = None
        self.w: E = None
        self.v: H = None
        self.z: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.w: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.y: A = None
        self.p: D = None
        self.s: G = None
        self.r: B = None
        self.u: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.s: F = None
        self.txt = txt

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

k = A("k")
a = B("a")
m = C("m")
n = D("n")
f = E("f")
g = F("g")
d = G("d")
b = H("b")
l = F("l")

k.y = m
k.x = l
k.t = b
k.r = a
a.y = g
a.s = k
a.q = k
a.x = f
a.w = f
a.v = b
a.z = l
m.r = k
n.p = g
n.w = d
f.w = n
f.p = n
f.u = n
f.y = k
f.s = d
f.r = a
g.u = l
d.x = n
d.s = g
b.s = g
b.w = g
b.t = n
b.z = a
b.q = a
b.u = m
l.u = g
assert a.q.x.u.u.u.txt == "g"