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

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

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

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.q: C = None
        self.u: C = None
        self.x: E = None
        self.v: A = None
        self.w: A = None
        self.t: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.s: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: A = None
        self.r: C = None
        self.s: A = None
        self.x: B = None
        self.t: E = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.q: C = None
        self.u: C = None
        self.x: E = None
        self.v: A = None
        self.w: A = None
        self.t: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.s: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: A = None
        self.r: C = None
        self.s: A = None
        self.x: B = None
        self.t: E = None
        self.txt = txt

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

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