class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.w: C = None
        self.t: D = None
        self.s: G = None
        self.txt = txt

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.v: C = None
        self.s: E = None
        self.o: D = None
        self.y: G = None
        self.u: B = None
        self.z: D = None
        self.txt = txt

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

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

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.v: C = None
        self.s: E = None
        self.o: D = None
        self.y: G = None
        self.u: B = None
        self.z: D = None
        self.txt = txt

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

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