class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.t: B = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.v: A = None
        self.p: A = None
        self.r: H = None
        self.txt = txt

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

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.v: A = None
        self.p: A = None
        self.r: H = None
        self.txt = txt

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

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

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

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