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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.o: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.v: E = None
        self.p: A = None
        self.y: E = None
        self.t: A = None
        self.x: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.o: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.v: E = None
        self.p: A = None
        self.y: E = None
        self.t: A = None
        self.x: C = None
        self.txt = txt

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

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