class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.q: C = None
        self.s: A = None
        self.p: D = None
        self.t: A = None
        self.o: A = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.w: B = None
        self.z: F = None
        self.y: D = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.w: B = None
        self.z: F = None
        self.y: D = None
        self.txt = txt

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

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

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