class A:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.y: G = None
        self.x: E = None
        self.v: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.z: D = None
        self.q: F = None
        self.x: D = None
        self.p: C = None
        self.w: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

l = A("l")
a = B("a")
h = C("h")
n = D("n")
d = E("d")
b = F("b")
c = G("c")
e = D("e")
m = B("m")
f = B("f")

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

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

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.y: G = None
        self.x: E = None
        self.v: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.z: D = None
        self.q: F = None
        self.x: D = None
        self.p: C = None
        self.w: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

l = A("l")
a = B("a")
h = C("h")
n = D("n")
d = E("d")
b = F("b")
c = G("c")
e = D("e")
m = B("m")
f = B("f")

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