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

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.t: E = None
        self.p: E = None
        self.v: E = None
        self.z: D = None
        self.txt = txt

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

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

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

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

n = A("n")
j = B("j")
l = C("l")
a = D("a")
e = E("e")
b = F("b")
h = C("h")

n.x = a
j.r = a
j.z = a
j.t = e
j.p = e
j.v = e
l.o = b
l.u = a
l.z = j
l.v = j
l.r = n
a.x = j
a.o = j
e.q = h
b.y = a
h.o = b
h.u = a
h.z = j
h.v = j
h.r = n
assert b.y.x.z.txt == "
class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.t: E = None
        self.p: E = None
        self.v: E = None
        self.z: D = None
        self.txt = txt

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

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

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

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

n = A("n")
j = B("j")
l = C("l")
a = D("a")
e = E("e")
b = F("b")
h = C("h")

n.x = a
j.r = a
j.z = a
j.t = e
j.p = e
j.v = e
l.o = b
l.u = a
l.z = j
l.v = j
l.r = n
a.x = j
a.o = j
e.q = h
b.y = a
h.o = b
h.u = a
h.z = j
h.v = j
h.r = n
assert b.y.x.z.txt == "a"