class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.q: E = None
        self.z: C = None
        self.u: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.p: B = None
        self.s: F = None
        self.x: D = None
        self.z: A = None
        self.u: F = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.p: B = None
        self.s: F = None
        self.x: D = None
        self.z: A = None
        self.u: F = None
        self.txt = txt

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

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

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

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

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