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

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

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.x: D = None
        self.v: B = None
        self.w: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.z: C = None
        self.w: D = None
        self.r: C = None
        self.txt = txt

d = A("d")
k = B("k")
l = C("l")
f = D("f")
b = E("b")
g = F("g")
h = G("h")
e = D("e")
n = E("n")

d.v = f
d.r = l
k.p = l
k.v = l
l.p = f
l.u = d
l.r = k
f.s = k
f.v = k
f.x = e
f.w = d
b.t = d
b.p = g
g.p = d
g.u = h
g.x = n
h.t = g
h.z = l
h.r = l
h.w = f
e.s = k
e.v = k
e.x = f
e.w = d
n.t = d
n.p = g
assert b.p.p.r.r.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.r: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.x: D = None
        self.v: B = None
        self.w: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.z: C = None
        self.w: D = None
        self.r: C = None
        self.txt = txt

d = A("d")
k = B("k")
l = C("l")
f = D("f")
b = E("b")
g = F("g")
h = G("h")
e = D("e")
n = E("n")

d.v = f
d.r = l
k.p = l
k.v = l
l.p = f
l.u = d
l.r = k
f.s = k
f.v = k
f.x = e
f.w = d
b.t = d
b.p = g
g.p = d
g.u = h
g.x = n
h.t = g
h.z = l
h.r = l
h.w = f
e.s = k
e.v = k
e.x = f
e.w = d
n.t = d
n.p = g
assert b.p.p.r.r.txt == "k"