class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.w: C = None
        self.t: F = None
        self.q: F = None
        self.u: F = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

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

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

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