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

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

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.y: A = None
        self.z: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.s: B = None
        self.y: H = None
        self.q: H = None
        self.p: F = None
        self.o: F = None
        self.r: H = None
        self.z: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.y: A = None
        self.z: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.s: B = None
        self.y: H = None
        self.q: H = None
        self.p: F = None
        self.o: F = None
        self.r: H = None
        self.z: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

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

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

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