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

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

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

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.q: A = None
        self.z: E = None
        self.s: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.q: A = None
        self.z: E = None
        self.s: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

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

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

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

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