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

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

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

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

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

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

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

n.p = g
l.r = n
l.x = f
l.w = i
l.z = a
i.s = e
i.t = g
i.w = n
i.y = a
g.p = e
g.o = a
g.w = i
a.p = f
e.q = a
e.u = a
e.o = n
e.y = l
e.v = f
c.r = n
c.x = f
c.w = i
c.z = a
f.p = e
f.o = a
f.w = i
assert i.t.w.t.txt == "
class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

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

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

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

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

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

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

n.p = g
l.r = n
l.x = f
l.w = i
l.z = a
i.s = e
i.t = g
i.w = n
i.y = a
g.p = e
g.o = a
g.w = i
a.p = f
e.q = a
e.u = a
e.o = n
e.y = l
e.v = f
c.r = n
c.x = f
c.w = i
c.z = a
f.p = e
f.o = a
f.w = i
assert i.t.w.t.txt == "g"