class A:
    def __init__(self, txt: str):
        self.y: H = None
        self.q: E = None
        self.p: H = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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