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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: J = None
        self.y: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.q: C = None
        self.s: C = None
        self.o: A = None
        self.v: A = None
        self.x: D = None
        self.r: I = None
        self.u: F = None
        self.z: F = None
        self.p: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: C = None
        self.y: B = None
        self.t: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: I = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: J = None
        self.y: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.q: C = None
        self.s: C = None
        self.o: A = None
        self.v: A = None
        self.x: D = None
        self.r: I = None
        self.u: F = None
        self.z: F = None
        self.p: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: C = None
        self.y: B = None
        self.t: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: I = None
        self.txt = txt

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

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