class A:
    def __init__(self, txt: str):
        self.r: G = None
        self.y: H = None
        self.v: D = None
        self.w: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.w: A = None
        self.o: A = None
        self.u: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.y: F = None
        self.t: A = None
        self.txt = txt

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.w: A = None
        self.o: A = None
        self.u: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.y: F = None
        self.t: A = None
        self.txt = txt

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

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

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

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

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

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

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