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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.v: A = None
        self.u: C = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.v: A = None
        self.u: C = None
        self.txt = txt

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

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

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