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

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

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.y: A = None
        self.x: B = None
        self.u: E = None
        self.s: E = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.y: A = None
        self.x: B = None
        self.u: E = None
        self.s: E = None
        self.txt = txt

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

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

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

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

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