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

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

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

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

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

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

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

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