class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.x: D = None
        self.r: A = None
        self.z: A = None
        self.u: C = None
        self.s: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.s: F = None
        self.u: A = None
        self.q: E = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.s: F = None
        self.u: A = None
        self.q: E = None
        self.txt = txt

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

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

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

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

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