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

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.w: F = None
        self.r: C = None
        self.q: F = None
        self.txt = txt

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

e = A("e")
l = B("l")
c = C("c")
i = D("i")
f = E("f")
g = F("g")
h = D("h")
j = F("j")
n = D("n")

e.y = f
e.u = f
e.o = j
e.p = c
l.x = g
c.z = h
c.y = f
c.v = f
c.w = f
c.o = i
c.u = g
i.v = f
i.s = h
i.p = h
i.u = g
f.u = l
f.w = g
f.q = g
f.r = c
g.q = e
h.v = f
h.s = i
h.p = n
h.u = g
j.q = e
n.v = f
n.s = i
n.p = i
n.u = j
assert g.q.o.q.o.q.o.txt == "
class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.o: F = None
        self.p: C = None
        self.u: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.w: F = None
        self.r: C = None
        self.q: F = None
        self.txt = txt

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

e = A("e")
l = B("l")
c = C("c")
i = D("i")
f = E("f")
g = F("g")
h = D("h")
j = F("j")
n = D("n")

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