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

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.x: H = None
        self.q: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.s: G = None
        self.o: I = None
        self.t: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.z: F = None
        self.q: C = None
        self.o: I = None
        self.v: C = None
        self.r: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.q: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: E = None
        self.o: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.x: H = None
        self.q: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.s: G = None
        self.o: I = None
        self.t: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.z: F = None
        self.q: C = None
        self.o: I = None
        self.v: C = None
        self.r: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.q: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: E = None
        self.o: F = None
        self.txt = txt

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

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