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

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.t: A = None
        self.q: E = None
        self.z: F = None
        self.x: F = None
        self.v: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: H = None
        self.y: C = None
        self.v: A = None
        self.s: H = None
        self.t: E = None
        self.p: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: A = None
        self.u: G = None
        self.q: A = None
        self.s: I = None
        self.v: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.o: H = None
        self.x: D = None
        self.u: A = None
        self.r: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: I = None
        self.s: H = None
        self.p: C = None
        self.x: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.s: F = None
        self.w: D = None
        self.q: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.t: A = None
        self.q: E = None
        self.z: F = None
        self.x: F = None
        self.v: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: H = None
        self.y: C = None
        self.v: A = None
        self.s: H = None
        self.t: E = None
        self.p: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: A = None
        self.u: G = None
        self.q: A = None
        self.s: I = None
        self.v: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.o: H = None
        self.x: D = None
        self.u: A = None
        self.r: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: I = None
        self.s: H = None
        self.p: C = None
        self.x: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.s: F = None
        self.w: D = None
        self.q: F = None
        self.txt = txt

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

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