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

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.y: G = None
        self.o: G = None
        self.u: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.q: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.p: E = None
        self.o: B = None
        self.u: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.y: B = None
        self.q: D = None
        self.txt = txt

i = A("i")
f = B("f")
c = C("c")
g = D("g")
h = E("h")
m = F("m")
d = G("d")
e = A("e")

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

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.y: G = None
        self.o: G = None
        self.u: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.q: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.p: E = None
        self.o: B = None
        self.u: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.y: B = None
        self.q: D = None
        self.txt = txt

i = A("i")
f = B("f")
c = C("c")
g = D("g")
h = E("h")
m = F("m")
d = G("d")
e = A("e")

i.o = g
i.u = g
i.r = e
i.p = c
f.r = m
f.y = d
f.o = d
f.u = d
c.w = g
c.q = d
g.w = h
g.v = d
g.s = c
h.z = e
h.u = d
h.y = d
h.p = f
h.x = f
h.v = m
m.r = d
m.p = h
m.o = f
m.u = c
d.s = f
d.y = f
d.q = g
e.o = g
e.u = g
e.r = i
e.p = c
assert e.u.s.w.s.q.s.r.u.txt == "c"