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

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

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

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

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

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

a = A("a")
c = B("c")
b = C("b")
f = D("f")
m = E("m")
d = F("d")
n = C("n")
g = E("g")
j = C("j")
i = D("i")

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

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

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

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

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

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

a = A("a")
c = B("c")
b = C("b")
f = D("f")
m = E("m")
d = F("d")
n = C("n")
g = E("g")
j = C("j")
i = D("i")

a.p = j
a.q = j
a.w = b
a.v = m
c.z = i
b.q = d
b.x = d
b.v = c
b.t = c
b.p = a
f.s = c
f.o = c
f.y = j
m.t = c
m.z = n
d.x = c
n.q = d
n.x = d
n.v = c
n.t = c
n.p = a
g.t = c
g.z = n
j.q = d
j.x = d
j.v = c
j.t = c
j.p = a
i.s = c
i.o = c
i.y = n
assert n.x.x.z.txt == "i"