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

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

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.r: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.v: B = None
        self.r: E = None
        self.u: B = None
        self.w: E = None
        self.txt = txt

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

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

l = A("l")
i = B("i")
j = C("j")
g = D("g")
m = E("m")
c = F("c")
e = C("e")
k = D("k")
n = F("n")
d = A("d")

l.t = j
i.s = j
i.u = j
i.o = k
j.o = n
j.r = e
g.t = m
g.r = m
g.w = m
g.v = i
g.u = i
m.w = c
m.t = k
m.o = e
c.w = n
c.p = i
e.o = c
e.r = j
k.t = m
k.r = m
k.w = m
k.v = i
k.u = i
n.w = c
n.p = i
d.t = j
assert n.p.s.o.w.w.p.u.o.w.p.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.r: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.v: B = None
        self.r: E = None
        self.u: B = None
        self.w: E = None
        self.txt = txt

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

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

l = A("l")
i = B("i")
j = C("j")
g = D("g")
m = E("m")
c = F("c")
e = C("e")
k = D("k")
n = F("n")
d = A("d")

l.t = j
i.s = j
i.u = j
i.o = k
j.o = n
j.r = e
g.t = m
g.r = m
g.w = m
g.v = i
g.u = i
m.w = c
m.t = k
m.o = e
c.w = n
c.p = i
e.o = c
e.r = j
k.t = m
k.r = m
k.w = m
k.v = i
k.u = i
n.w = c
n.p = i
d.t = j
assert n.p.s.o.w.w.p.u.o.w.p.txt == "i"