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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

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

i.y = d
i.p = g
i.v = g
d.v = j
b.v = l
b.w = d
j.w = f
j.u = d
j.x = l
j.v = m
l.r = j
l.s = b
g.r = j
f.r = j
f.s = b
m.r = j
m.s = b
n.r = j
n.s = b
assert b.w.v.w.r.v.r.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: F = None
        self.v: F = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

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

i.y = d
i.p = g
i.v = g
d.v = j
b.v = l
b.w = d
j.w = f
j.u = d
j.x = l
j.v = m
l.r = j
l.s = b
g.r = j
f.r = j
f.s = b
m.r = j
m.s = b
n.r = j
n.s = b
assert b.w.v.w.r.v.r.txt == "j"