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

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.t: A = None
        self.r: D = None
        self.u: I = None
        self.x: D = None
        self.s: G = None
        self.z: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: H = None
        self.o: H = None
        self.y: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.w: B = None
        self.r: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.q: A = None
        self.p: D = None
        self.w: F = None
        self.z: I = None
        self.x: A = None
        self.u: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: I = None
        self.u: A = None
        self.v: C = None
        self.r: I = None
        self.o: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: C = None
        self.o: G = None
        self.y: F = None
        self.u: C = None
        self.p: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.t: A = None
        self.r: D = None
        self.u: I = None
        self.x: D = None
        self.s: G = None
        self.z: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: H = None
        self.o: H = None
        self.y: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.w: B = None
        self.r: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.q: A = None
        self.p: D = None
        self.w: F = None
        self.z: I = None
        self.x: A = None
        self.u: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: I = None
        self.u: A = None
        self.v: C = None
        self.r: I = None
        self.o: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: C = None
        self.o: G = None
        self.y: F = None
        self.u: C = None
        self.p: D = None
        self.txt = txt

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

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