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

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

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

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

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

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

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