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

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

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.v: F = None
        self.o: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.p: A = None
        self.y: C = None
        self.txt = txt

c = A("c")
k = B("k")
a = C("a")
l = D("l")
i = E("i")
b = F("b")
j = D("j")
d = A("d")

c.x = d
c.t = k
c.y = k
c.p = b
k.t = a
k.y = a
k.o = l
a.x = b
a.v = b
a.o = i
l.w = i
l.y = i
l.z = i
l.x = j
l.u = c
i.p = l
i.o = b
i.y = b
i.w = c
i.x = k
b.q = c
b.p = d
b.y = a
j.w = i
j.y = i
j.z = i
j.x = l
j.u = c
d.x = c
d.t = k
d.y = k
d.p = b
assert c.y.y.x.q.x.p.q.x.txt == "
class A:
    def __init__(self, txt: str):
        self.x: A = None
        self.t: B = None
        self.y: B = None
        self.p: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.v: F = None
        self.o: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.p: A = None
        self.y: C = None
        self.txt = txt

c = A("c")
k = B("k")
a = C("a")
l = D("l")
i = E("i")
b = F("b")
j = D("j")
d = A("d")

c.x = d
c.t = k
c.y = k
c.p = b
k.t = a
k.y = a
k.o = l
a.x = b
a.v = b
a.o = i
l.w = i
l.y = i
l.z = i
l.x = j
l.u = c
i.p = l
i.o = b
i.y = b
i.w = c
i.x = k
b.q = c
b.p = d
b.y = a
j.w = i
j.y = i
j.z = i
j.x = l
j.u = c
d.x = c
d.t = k
d.y = k
d.p = b
assert c.y.y.x.q.x.p.q.x.txt == "d"