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

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

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

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.s: F = None
        self.r: C = None
        self.z: B = None
        self.t: F = None
        self.u: B = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.s: F = None
        self.r: C = None
        self.z: B = None
        self.t: F = None
        self.u: B = None
        self.txt = txt

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

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

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

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