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

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

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

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

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

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

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

k.p = j
k.z = g
k.t = g
k.o = e
e.v = k
e.x = b
e.p = b
e.t = i
e.o = g
d.x = n
d.y = g
d.t = b
d.q = k
j.s = e
j.y = n
g.z = k
g.w = n
g.q = n
g.t = d
n.p = k
n.q = e
n.w = e
n.t = d
i.p = k
i.q = b
i.w = b
i.t = d
b.v = k
b.x = e
b.p = e
b.t = n
b.o = g
assert g.t.q.o.txt == "
class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.z: E = None
        self.t: E = None
        self.o: B = None
        self.txt = txt

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

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

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

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

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

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

k.p = j
k.z = g
k.t = g
k.o = e
e.v = k
e.x = b
e.p = b
e.t = i
e.o = g
d.x = n
d.y = g
d.t = b
d.q = k
j.s = e
j.y = n
g.z = k
g.w = n
g.q = n
g.t = d
n.p = k
n.q = e
n.w = e
n.t = d
i.p = k
i.q = b
i.w = b
i.t = d
b.v = k
b.x = e
b.p = e
b.t = n
b.o = g
assert g.t.q.o.txt == "e"