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

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

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

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.v: F = None
        self.o: B = None
        self.s: B = None
        self.x: A = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.v: F = None
        self.o: B = None
        self.s: B = None
        self.x: A = None
        self.txt = txt

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

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

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

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