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

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

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.t: B = None
        self.p: B = None
        self.q: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: C = None
        self.x: D = None
        self.p: C = None
        self.w: C = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.t: B = None
        self.p: B = None
        self.q: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: C = None
        self.x: D = None
        self.p: C = None
        self.w: C = None
        self.txt = txt

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

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

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