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

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.s: F = None
        self.r: C = None
        self.q: C = None
        self.p: J = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.p: J = None
        self.w: I = None
        self.r: I = None
        self.y: F = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.s: F = None
        self.r: C = None
        self.q: C = None
        self.p: J = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.p: J = None
        self.w: I = None
        self.r: I = None
        self.y: F = None
        self.txt = txt

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

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

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

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

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