class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.r: C = None
        self.t: D = None
        self.u: F = None
        self.p: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.s: C = None
        self.r: C = None
        self.w: F = None
        self.o: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: E = None
        self.o: B = None
        self.r: D = None
        self.x: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: F = None
        self.y: A = None
        self.v: A = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.s: C = None
        self.r: C = None
        self.w: F = None
        self.o: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: E = None
        self.o: B = None
        self.r: D = None
        self.x: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: F = None
        self.y: A = None
        self.v: A = None
        self.txt = txt

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

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