class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.x: D = None
        self.w: C = None
        self.u: C = None
        self.z: D = None
        self.t: D = None
        self.p: C = None
        self.y: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.v: E = None
        self.q: G = None
        self.o: B = None
        self.w: G = None
        self.y: E = None
        self.s: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: H = None
        self.t: C = None
        self.y: C = None
        self.o: G = None
        self.z: B = None
        self.x: G = None
        self.w: G = None
        self.u: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: G = None
        self.v: G = None
        self.y: C = None
        self.r: G = None
        self.z: A = None
        self.u: D = None
        self.x: E = None
        self.t: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: E = None
        self.z: A = None
        self.x: D = None
        self.q: H = None
        self.s: H = None
        self.t: D = None
        self.w: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.v: E = None
        self.q: G = None
        self.o: B = None
        self.w: G = None
        self.y: E = None
        self.s: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: H = None
        self.t: C = None
        self.y: C = None
        self.o: G = None
        self.z: B = None
        self.x: G = None
        self.w: G = None
        self.u: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: G = None
        self.v: G = None
        self.y: C = None
        self.r: G = None
        self.z: A = None
        self.u: D = None
        self.x: E = None
        self.t: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: E = None
        self.z: A = None
        self.x: D = None
        self.q: H = None
        self.s: H = None
        self.t: D = None
        self.w: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

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