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

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

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.o: E = None
        self.r: B = None
        self.txt = txt

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

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

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

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

a.v = d
a.p = n
a.r = j
a.q = f
i.w = k
i.q = k
i.p = a
i.y = f
i.s = n
d.u = f
d.o = f
d.r = k
g.y = b
g.p = j
f.t = n
f.o = b
f.z = i
n.w = a
n.p = d
n.v = b
j.v = d
j.p = n
j.r = a
j.q = f
b.y = g
b.p = j
k.w = i
k.q = i
k.p = a
k.y = f
k.s = n
assert g.p.r.r.r.p.w.q.o.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.p: F = None
        self.r: A = None
        self.q: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.o: E = None
        self.r: B = None
        self.txt = txt

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

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

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

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

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