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

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

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

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.y: F = None
        self.q: G = None
        self.o: B = None
        self.txt = txt

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

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.y: F = None
        self.q: G = None
        self.o: B = None
        self.txt = txt

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

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

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

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

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