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

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.y: E = None
        self.x: D = None
        self.q: F = None
        self.p: D = None
        self.s: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: H = None
        self.r: F = None
        self.q: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.y: E = None
        self.t: B = None
        self.u: D = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.y: E = None
        self.x: D = None
        self.q: F = None
        self.p: D = None
        self.s: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: H = None
        self.r: F = None
        self.q: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.y: E = None
        self.t: B = None
        self.u: D = None
        self.txt = txt

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

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

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

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