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

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

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.w: E = None
        self.y: D = None
        self.v: C = None
        self.p: A = None
        self.r: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: D = None
        self.z: D = None
        self.u: F = None
        self.v: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.q: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.x: D = None
        self.w: D = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.w: E = None
        self.y: D = None
        self.v: C = None
        self.p: A = None
        self.r: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: D = None
        self.z: D = None
        self.u: F = None
        self.v: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.q: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.x: D = None
        self.w: D = None
        self.txt = txt

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

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

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