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

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

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.t: E = None
        self.x: F = None
        self.p: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.s: H = None
        self.p: G = None
        self.q: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.z: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: H = None
        self.y: F = None
        self.z: C = None
        self.r: H = None
        self.w: B = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.t: E = None
        self.x: F = None
        self.p: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.s: H = None
        self.p: G = None
        self.q: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.z: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: H = None
        self.y: F = None
        self.z: C = None
        self.r: H = None
        self.w: B = None
        self.txt = txt

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

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

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