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

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.o: D = None
        self.q: A = None
        self.s: E = None
        self.u: D = None
        self.r: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.t: C = None
        self.v: D = None
        self.z: C = None
        self.o: A = None
        self.y: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.o: D = None
        self.q: A = None
        self.s: E = None
        self.u: D = None
        self.r: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.t: C = None
        self.v: D = None
        self.z: C = None
        self.o: A = None
        self.y: F = None
        self.txt = txt

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

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