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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.v: F = None
        self.y: D = None
        self.z: D = None
        self.s: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.t: E = None
        self.u: E = None
        self.p: H = None
        self.q: A = None
        self.v: C = None
        self.r: C = None
        self.s: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: F = None
        self.y: D = None
        self.w: B = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.v: F = None
        self.y: D = None
        self.z: D = None
        self.s: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.t: E = None
        self.u: E = None
        self.p: H = None
        self.q: A = None
        self.v: C = None
        self.r: C = None
        self.s: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: F = None
        self.y: D = None
        self.w: B = None
        self.txt = txt

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

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