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

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

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.w: A = None
        self.x: E = None
        self.txt = txt

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

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

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

l = A("l")
n = B("n")
j = C("j")
e = D("e")
g = E("g")
a = F("a")
i = C("i")
k = E("k")

l.x = n
l.y = n
l.z = i
l.w = a
n.y = i
n.w = k
n.z = l
n.p = e
n.r = e
j.y = k
j.w = l
j.x = g
e.p = a
g.y = k
g.x = k
g.o = a
g.p = a
g.z = l
g.t = e
a.t = n
a.v = i
i.y = g
i.w = l
i.x = k
k.y = g
k.x = g
k.o = a
k.p = a
k.z = l
k.t = e
assert i.y.y.x.z.x.txt == "
class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.z: C = None
        self.y: B = None
        self.w: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.w: A = None
        self.x: E = None
        self.txt = txt

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

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

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

l = A("l")
n = B("n")
j = C("j")
e = D("e")
g = E("g")
a = F("a")
i = C("i")
k = E("k")

l.x = n
l.y = n
l.z = i
l.w = a
n.y = i
n.w = k
n.z = l
n.p = e
n.r = e
j.y = k
j.w = l
j.x = g
e.p = a
g.y = k
g.x = k
g.o = a
g.p = a
g.z = l
g.t = e
a.t = n
a.v = i
i.y = g
i.w = l
i.x = k
k.y = g
k.x = g
k.o = a
k.p = a
k.z = l
k.t = e
assert i.y.y.x.z.x.txt == "n"