class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.v: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.p: E = None
        self.w: C = None
        self.z: F = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.p: E = None
        self.w: C = None
        self.z: F = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

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

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