class A:
    def __init__(self, txt: str):
        self.q: A = None
        self.s: F = None
        self.t: A = None
        self.o: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.p: D = None
        self.o: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: F = None
        self.u: D = None
        self.x: A = None
        self.t: D = None
        self.o: F = None
        self.txt = txt

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

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

m.q = f
m.t = f
m.s = i
m.o = a
a.x = n
a.p = b
a.o = l
g.v = a
g.q = a
g.s = c
c.w = d
c.x = g
c.y = i
l.v = f
l.x = f
l.q = i
l.o = i
l.u = c
l.t = b
i.p = n
i.t = n
f.q = m
f.t = m
f.s = i
f.o = a
d.v = f
d.x = f
d.q = i
d.o = i
d.u = b
d.t = c
n.v = a
n.q = a
n.s = b
b.w = l
b.x = n
b.y = i
assert g.q.x.s.x.q.p.y.p.s.w.txt == "
class A:
    def __init__(self, txt: str):
        self.q: A = None
        self.s: F = None
        self.t: A = None
        self.o: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.p: D = None
        self.o: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: F = None
        self.u: D = None
        self.x: A = None
        self.t: D = None
        self.o: F = None
        self.txt = txt

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

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

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