class A:
    def __init__(self, txt: str):
        self.v: G = None
        self.r: F = None
        self.w: H = None
        self.q: D = None
        self.x: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.z: C = None
        self.q: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.q: H = None
        self.v: G = None
        self.x: H = None
        self.u: D = None
        self.r: E = None
        self.o: G = None
        self.z: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: C = None
        self.z: E = None
        self.x: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.z: C = None
        self.q: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.q: H = None
        self.v: G = None
        self.x: H = None
        self.u: D = None
        self.r: E = None
        self.o: G = None
        self.z: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: C = None
        self.z: E = None
        self.x: C = None
        self.txt = txt

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

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