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

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.z: F = None
        self.r: E = None
        self.w: C = None
        self.s: A = None
        self.x: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.y: D = None
        self.o: A = None
        self.v: A = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.z: F = None
        self.r: E = None
        self.w: C = None
        self.s: A = None
        self.x: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.y: D = None
        self.o: A = None
        self.v: A = None
        self.txt = txt

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

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

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

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

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