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

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.p: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.t: D = None
        self.w: F = None
        self.v: F = None
        self.q: D = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.p: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.t: D = None
        self.w: F = None
        self.v: F = None
        self.q: D = None
        self.txt = txt

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

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

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

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