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

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

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.o: F = None
        self.r: B = None
        self.v: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.y: E = None
        self.t: F = None
        self.s: E = None
        self.v: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.t: D = None
        self.u: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.o: F = None
        self.r: B = None
        self.v: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.y: E = None
        self.t: F = None
        self.s: E = None
        self.v: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.t: D = None
        self.u: A = None
        self.txt = txt

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

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