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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.y: B = None
        self.r: F = None
        self.o: B = None
        self.v: C = None
        self.u: D = None
        self.txt = txt

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

g = A("g")
e = B("e")
j = C("j")
l = D("l")
a = E("a")
c = F("c")
n = B("n")
h = D("h")
b = A("b")
f = C("f")

g.o = a
g.v = a
g.p = a
g.z = c
g.u = c
g.w = j
e.z = j
e.o = j
e.r = c
e.v = h
e.t = h
e.u = n
j.p = c
l.u = c
l.w = a
l.q = n
l.o = b
a.w = l
a.u = l
a.y = e
a.o = e
a.r = c
a.v = f
c.x = e
n.z = f
n.o = f
n.r = c
n.v = h
n.u = e
n.t = l
h.u = c
h.w = a
h.q = n
h.o = b
b.o = a
b.v = a
b.p = a
b.z = c
b.u = c
b.w = f
f.p = c
assert f.p.x.u.o.p.x.r.x.o.p.txt == "
class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.z: F = None
        self.u: F = None
        self.w: C = None
        self.v: E = None
        self.p: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.y: B = None
        self.r: F = None
        self.o: B = None
        self.v: C = None
        self.u: D = None
        self.txt = txt

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

g = A("g")
e = B("e")
j = C("j")
l = D("l")
a = E("a")
c = F("c")
n = B("n")
h = D("h")
b = A("b")
f = C("f")

g.o = a
g.v = a
g.p = a
g.z = c
g.u = c
g.w = j
e.z = j
e.o = j
e.r = c
e.v = h
e.t = h
e.u = n
j.p = c
l.u = c
l.w = a
l.q = n
l.o = b
a.w = l
a.u = l
a.y = e
a.o = e
a.r = c
a.v = f
c.x = e
n.z = f
n.o = f
n.r = c
n.v = h
n.u = e
n.t = l
h.u = c
h.w = a
h.q = n
h.o = b
b.o = a
b.v = a
b.p = a
b.z = c
b.u = c
b.w = f
f.p = c
assert f.p.x.u.o.p.x.r.x.o.p.txt == "c"