class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.u: D = None
        self.o: E = None
        self.w: F = None
        self.v: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.u: F = None
        self.y: E = None
        self.q: F = None
        self.v: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.s: E = None
        self.q: E = None
        self.v: G = None
        self.t: C = None
        self.r: A = None
        self.z: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.w: G = None
        self.z: A = None
        self.u: G = None
        self.q: F = None
        self.t: A = None
        self.r: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.p: E = None
        self.t: F = None
        self.txt = txt

k = A("k")
j = B("j")
f = C("f")
n = D("n")
h = E("h")
c = F("c")
l = G("l")

k.y = f
k.u = n
k.v = n
k.o = h
k.w = c
j.r = h
j.q = n
f.x = h
f.y = h
f.u = c
f.q = c
f.v = l
n.o = k
n.r = k
n.s = h
n.q = h
n.z = h
n.v = l
n.t = f
h.o = c
h.q = c
h.w = l
h.u = l
h.z = k
h.t = k
h.r = f
c.t = f
c.w = l
l.z = j
l.p = h
l.t = c
assert c.t.x.q.t.u.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.u: D = None
        self.o: E = None
        self.w: F = None
        self.v: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.u: F = None
        self.y: E = None
        self.q: F = None
        self.v: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.s: E = None
        self.q: E = None
        self.v: G = None
        self.t: C = None
        self.r: A = None
        self.z: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.w: G = None
        self.z: A = None
        self.u: G = None
        self.q: F = None
        self.t: A = None
        self.r: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.p: E = None
        self.t: F = None
        self.txt = txt

k = A("k")
j = B("j")
f = C("f")
n = D("n")
h = E("h")
c = F("c")
l = G("l")

k.y = f
k.u = n
k.v = n
k.o = h
k.w = c
j.r = h
j.q = n
f.x = h
f.y = h
f.u = c
f.q = c
f.v = l
n.o = k
n.r = k
n.s = h
n.q = h
n.z = h
n.v = l
n.t = f
h.o = c
h.q = c
h.w = l
h.u = l
h.z = k
h.t = k
h.r = f
c.t = f
c.w = l
l.z = j
l.p = h
l.t = c
assert c.t.x.q.t.u.txt == "c"