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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

e = A("e")
j = B("j")
i = C("i")
f = D("f")
l = E("l")
m = F("m")
n = G("n")
c = E("c")
a = A("a")

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

e = A("e")
j = B("j")
i = C("i")
f = D("f")
l = E("l")
m = F("m")
n = G("n")
c = E("c")
a = A("a")

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