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

class B:
    def __init__(self, txt: str):
        self.z: H = None
        self.u: E = None
        self.r: H = None
        self.t: F = None
        self.w: F = None
        self.o: C = None
        self.p: H = None
        self.v: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.o: F = None
        self.q: H = None
        self.v: A = None
        self.z: D = None
        self.s: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.t: A = None
        self.u: H = None
        self.x: B = None
        self.v: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: E = None
        self.o: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: H = None
        self.u: E = None
        self.r: H = None
        self.t: F = None
        self.w: F = None
        self.o: C = None
        self.p: H = None
        self.v: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.o: F = None
        self.q: H = None
        self.v: A = None
        self.z: D = None
        self.s: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.t: A = None
        self.u: H = None
        self.x: B = None
        self.v: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: E = None
        self.o: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

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

a.r = f
a.p = j
j.z = d
j.r = d
j.p = d
j.u = n
j.t = h
j.w = h
j.o = e
j.v = c
e.p = f
e.o = h
e.q = d
e.s = d
e.v = a
e.z = g
f.q = a
f.t = a
f.u = d
f.v = d
f.x = c
n.y = a
h.q = a
h.u = a
h.s = n
m.v = n
m.o = f
d.x = a
g.q = a
g.t = a
g.u = d
g.v = d
g.x = c
c.z = d
c.r = d
c.p = d
c.u = n
c.t = h
c.w = h
c.o = e
c.v = j
assert c.t.q.r.x.w.txt == "h"