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

class B:
    def __init__(self, txt: str):
        self.y: H = None
        self.p: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: J = None
        self.x: I = None
        self.z: B = None
        self.q: B = None
        self.o: J = None
        self.txt = txt

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

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

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

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

class J:
    def __init__(self, txt: str):
        self.p: A = None
        self.s: D = None
        self.w: B = None
        self.x: B = None
        self.txt = txt

h = A("h")
i = B("i")
k = C("k")
c = D("c")
e = E("e")
b = F("b")
n = G("n")
f = H("f")
l = I("l")
g = J("g")

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

class B:
    def __init__(self, txt: str):
        self.y: H = None
        self.p: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: J = None
        self.x: I = None
        self.z: B = None
        self.q: B = None
        self.o: J = None
        self.txt = txt

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

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

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

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

class J:
    def __init__(self, txt: str):
        self.p: A = None
        self.s: D = None
        self.w: B = None
        self.x: B = None
        self.txt = txt

h = A("h")
i = B("i")
k = C("k")
c = D("c")
e = E("e")
b = F("b")
n = G("n")
f = H("f")
l = I("l")
g = J("g")

h.t = e
i.y = f
i.p = k
k.x = c
k.p = n
k.y = e
c.r = n
e.v = g
e.o = g
e.x = l
e.z = i
e.q = i
b.y = h
b.s = h
b.v = e
n.y = h
f.v = i
f.o = i
f.z = e
l.z = f
l.o = g
g.p = h
g.s = c
g.w = i
g.x = i
assert e.x.z.v.p.y.v.txt == "g"