class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.r: G = None
        self.z: F = None
        self.v: C = None
        self.p: B = None
        self.u: I = None
        self.x: G = None
        self.s: H = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: A = None
        self.r: H = None
        self.x: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.z: D = None
        self.r: B = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: A = None
        self.r: H = None
        self.x: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.z: D = None
        self.r: B = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

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

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