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

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

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

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.x: B = None
        self.o: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.w: B = None
        self.z: E = None
        self.y: B = None
        self.u: F = None
        self.txt = txt

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

d.z = f
d.q = h
d.p = h
d.v = m
l.v = m
l.p = d
l.z = d
l.s = e
l.w = h
l.o = h
h.u = n
n.p = m
n.x = e
n.o = f
m.s = b
m.y = n
k.x = l
k.y = l
k.w = e
k.z = m
k.u = b
f.v = m
f.p = d
f.z = d
f.s = l
f.w = h
f.o = h
g.p = m
g.x = e
g.o = l
b.x = e
b.w = e
b.y = e
b.z = m
b.u = k
e.v = m
e.p = d
e.z = d
e.s = f
e.w = h
e.o = h
assert n.x.v.y.p.y.o.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.q: C = None
        self.p: C = None
        self.v: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.x: B = None
        self.o: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.w: B = None
        self.z: E = None
        self.y: B = None
        self.u: F = None
        self.txt = txt

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

d.z = f
d.q = h
d.p = h
d.v = m
l.v = m
l.p = d
l.z = d
l.s = e
l.w = h
l.o = h
h.u = n
n.p = m
n.x = e
n.o = f
m.s = b
m.y = n
k.x = l
k.y = l
k.w = e
k.z = m
k.u = b
f.v = m
f.p = d
f.z = d
f.s = l
f.w = h
f.o = h
g.p = m
g.x = e
g.o = l
b.x = e
b.w = e
b.y = e
b.z = m
b.u = k
e.v = m
e.p = d
e.z = d
e.s = f
e.w = h
e.o = h
assert n.x.v.y.p.y.o.txt == "f"