class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.o: C = None
        self.y: E = None
        self.q: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.t: F = None
        self.s: B = None
        self.z: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.s: D = None
        self.q: B = None
        self.p: D = None
        self.w: D = None
        self.txt = txt

f = A("f")
m = B("m")
l = C("l")
j = D("j")
n = E("n")
a = F("a")

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

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

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

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.t: F = None
        self.s: B = None
        self.z: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.s: D = None
        self.q: B = None
        self.p: D = None
        self.w: D = None
        self.txt = txt

f = A("f")
m = B("m")
l = C("l")
j = D("j")
n = E("n")
a = F("a")

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