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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.v: A = None
        self.r: D = None
        self.y: E = None
        self.x: A = None
        self.s: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.o: F = None
        self.u: C = None
        self.y: H = None
        self.s: D = None
        self.x: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: H = None
        self.x: C = None
        self.q: H = None
        self.u: G = None
        self.txt = txt

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

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

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

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

c.y = l
c.r = l
c.x = d
j.u = c
j.v = c
j.x = c
j.r = g
j.y = l
j.s = k
m.y = c
m.v = f
g.z = k
l.z = j
l.o = d
l.u = m
l.y = k
l.s = g
l.x = f
d.r = k
d.q = k
d.x = m
d.u = f
n.u = i
k.x = j
k.u = j
k.s = c
i.y = j
i.q = g
f.u = i
assert j.s.s.x.txt == "
class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.x: F = None
        self.r: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.v: A = None
        self.r: D = None
        self.y: E = None
        self.x: A = None
        self.s: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.o: F = None
        self.u: C = None
        self.y: H = None
        self.s: D = None
        self.x: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: H = None
        self.x: C = None
        self.q: H = None
        self.u: G = None
        self.txt = txt

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

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

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

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

c.y = l
c.r = l
c.x = d
j.u = c
j.v = c
j.x = c
j.r = g
j.y = l
j.s = k
m.y = c
m.v = f
g.z = k
l.z = j
l.o = d
l.u = m
l.y = k
l.s = g
l.x = f
d.r = k
d.q = k
d.x = m
d.u = f
n.u = i
k.x = j
k.u = j
k.s = c
i.y = j
i.q = g
f.u = i
assert j.s.s.x.txt == "d"