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

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

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

class D:
    def __init__(self, txt: str):
        self.y: H = None
        self.x: E = None
        self.w: F = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.s: D = None
        self.w: E = None
        self.z: E = None
        self.txt = txt

d = A("d")
e = B("e")
f = C("f")
j = D("j")
k = E("k")
b = F("b")
m = G("m")
g = H("g")
c = G("c")
h = A("h")

d.r = e
d.z = m
d.u = j
e.z = f
e.q = f
e.u = f
e.y = d
e.x = c
f.w = e
f.z = e
f.p = e
j.y = g
j.x = k
j.w = b
k.t = j
b.r = j
m.r = d
m.u = f
m.x = b
g.s = j
g.w = k
g.z = k
c.r = d
c.u = f
c.x = b
h.r = e
h.z = c
h.u = j
assert b.r.y.s.x.t.x.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.z: G = None
        self.u: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: H = None
        self.x: E = None
        self.w: F = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.s: D = None
        self.w: E = None
        self.z: E = None
        self.txt = txt

d = A("d")
e = B("e")
f = C("f")
j = D("j")
k = E("k")
b = F("b")
m = G("m")
g = H("g")
c = G("c")
h = A("h")

d.r = e
d.z = m
d.u = j
e.z = f
e.q = f
e.u = f
e.y = d
e.x = c
f.w = e
f.z = e
f.p = e
j.y = g
j.x = k
j.w = b
k.t = j
b.r = j
m.r = d
m.u = f
m.x = b
g.s = j
g.w = k
g.z = k
c.r = d
c.u = f
c.x = b
h.r = e
h.z = c
h.u = j
assert b.r.y.s.x.t.x.txt == "k"