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

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

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

class D:
    def __init__(self, txt: str):
        self.v: H = None
        self.p: H = None
        self.q: C = None
        self.r: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.s: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: H = None
        self.q: C = None
        self.v: F = None
        self.txt = txt

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

g = A("g")
h = B("h")
a = C("a")
c = D("c")
b = E("b")
j = F("j")
m = G("m")
i = H("i")

g.o = b
g.y = b
g.p = j
g.w = c
g.v = h
h.r = c
h.v = c
h.z = g
h.o = g
a.z = j
c.v = i
c.p = i
c.q = a
c.r = b
b.v = a
b.y = a
j.v = m
j.s = i
m.y = i
m.q = a
m.v = j
i.t = g
assert g.y.v.z.s.t.w.r.txt == "
class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.p: F = None
        self.w: D = None
        self.v: B = None
        self.y: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.v: H = None
        self.p: H = None
        self.q: C = None
        self.r: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.s: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: H = None
        self.q: C = None
        self.v: F = None
        self.txt = txt

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

g = A("g")
h = B("h")
a = C("a")
c = D("c")
b = E("b")
j = F("j")
m = G("m")
i = H("i")

g.o = b
g.y = b
g.p = j
g.w = c
g.v = h
h.r = c
h.v = c
h.z = g
h.o = g
a.z = j
c.v = i
c.p = i
c.q = a
c.r = b
b.v = a
b.y = a
j.v = m
j.s = i
m.y = i
m.q = a
m.v = j
i.t = g
assert g.y.v.z.s.t.w.r.txt == "b"