class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.o: D = None
        self.w: A = None
        self.y: C = None
        self.q: E = None
        self.r: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: D = None
        self.v: E = None
        self.p: A = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.x: D = None
        self.v: E = None
        self.p: A = None
        self.txt = txt

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

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

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

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