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

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

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

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

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

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

i = A("i")
g = B("g")
f = C("f")
b = D("b")
a = E("a")
m = F("m")
c = F("c")
l = C("l")

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

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

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

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

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

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

i = A("i")
g = B("g")
f = C("f")
b = D("b")
a = E("a")
m = F("m")
c = F("c")
l = C("l")

i.s = g
i.v = l
i.w = c
g.u = b
f.w = g
f.y = b
f.q = b
b.p = c
a.s = l
a.w = i
a.q = i
a.r = g
m.o = c
m.p = g
m.t = g
m.q = l
m.y = b
m.u = i
c.o = m
c.p = g
c.t = g
c.q = l
c.y = b
c.u = i
l.w = g
l.y = b
l.q = b
assert c.y.p.p.u.p.txt == "c"