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

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

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

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

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

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

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

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

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

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

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

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

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

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

d.v = l
d.r = l
d.w = h
d.q = c
f.o = d
f.p = d
f.u = n
f.q = b
f.v = j
n.o = i
n.q = l
n.x = l
n.r = c
b.r = d
b.z = c
b.v = f
b.w = l
b.x = n
c.v = n
l.x = b
l.p = c
j.o = d
j.p = d
j.u = k
j.q = b
j.v = f
k.o = n
k.q = l
k.x = l
k.r = c
i.o = k
i.q = l
i.x = l
i.r = c
h.o = d
h.p = d
h.u = n
h.q = b
h.v = j
assert n.r.v.x.p.txt == "c"