class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.q: B = None
        self.w: B = None
        self.v: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.r: F = None
        self.o: D = None
        self.v: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.r: E = None
        self.v: B = None
        self.p: C = None
        self.o: E = None
        self.y: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.z: A = None
        self.u: B = None
        self.txt = txt

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

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

e.r = i
e.q = k
e.w = k
e.v = a
k.z = n
k.y = a
k.w = a
k.q = a
k.p = e
k.r = g
g.w = a
g.o = a
g.r = i
g.v = k
a.s = e
a.r = n
a.o = n
a.v = k
a.p = g
a.y = i
n.q = d
n.z = d
n.u = k
i.p = n
d.r = i
d.q = k
d.w = k
d.v = a
assert a.s.v.v.r.w.v.p.txt == "
class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.q: B = None
        self.w: B = None
        self.v: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.r: F = None
        self.o: D = None
        self.v: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.r: E = None
        self.v: B = None
        self.p: C = None
        self.o: E = None
        self.y: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.z: A = None
        self.u: B = None
        self.txt = txt

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

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

e.r = i
e.q = k
e.w = k
e.v = a
k.z = n
k.y = a
k.w = a
k.q = a
k.p = e
k.r = g
g.w = a
g.o = a
g.r = i
g.v = k
a.s = e
a.r = n
a.o = n
a.v = k
a.p = g
a.y = i
n.q = d
n.z = d
n.u = k
i.p = n
d.r = i
d.q = k
d.w = k
d.v = a
assert a.s.v.v.r.w.v.p.txt == "e"