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

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

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

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

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

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

b = A("b")
e = B("e")
f = C("f")
n = D("n")
h = E("h")
j = F("j")
c = F("c")
m = D("m")
i = A("i")
d = F("d")

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

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

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

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

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

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

b = A("b")
e = B("e")
f = C("f")
n = D("n")
h = E("h")
j = F("j")
c = F("c")
m = D("m")
i = A("i")
d = F("d")

b.o = m
b.w = e
b.v = i
b.q = i
b.p = h
b.r = h
e.u = b
e.r = f
e.q = h
f.x = n
f.z = j
n.o = f
n.r = c
n.u = m
n.y = e
h.s = f
h.t = e
h.w = j
j.w = f
j.v = h
j.o = h
j.q = d
c.w = f
c.v = h
c.o = h
c.q = j
m.o = f
m.r = c
m.u = n
m.y = e
i.o = n
i.w = e
i.v = b
i.q = b
i.p = h
i.r = h
d.w = f
d.v = h
d.o = h
d.q = c
assert c.q.o.w.txt == "j"