class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.u: C = None
        self.s: G = None
        self.q: D = None
        self.p: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: F = None
        self.y: F = None
        self.o: F = None
        self.p: D = None
        self.t: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.p: F = None
        self.w: A = None
        self.z: B = None
        self.u: C = None
        self.o: C = None
        self.x: B = None
        self.txt = txt

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

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

h = A("h")
d = B("d")
k = C("k")
l = D("l")
g = E("g")
i = F("i")
c = G("c")

h.o = k
h.u = k
h.s = c
h.p = c
h.q = l
d.q = i
d.z = k
d.x = k
d.y = l
d.p = g
d.u = c
k.q = l
k.p = l
k.s = i
k.y = i
k.o = i
k.t = i
l.t = i
l.w = c
g.q = h
g.w = h
g.p = i
g.z = d
g.x = d
g.u = k
g.o = k
i.w = l
c.y = h
assert c.y.u.y.w.w.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.u: C = None
        self.s: G = None
        self.q: D = None
        self.p: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: F = None
        self.y: F = None
        self.o: F = None
        self.p: D = None
        self.t: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.p: F = None
        self.w: A = None
        self.z: B = None
        self.u: C = None
        self.o: C = None
        self.x: B = None
        self.txt = txt

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

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

h = A("h")
d = B("d")
k = C("k")
l = D("l")
g = E("g")
i = F("i")
c = G("c")

h.o = k
h.u = k
h.s = c
h.p = c
h.q = l
d.q = i
d.z = k
d.x = k
d.y = l
d.p = g
d.u = c
k.q = l
k.p = l
k.s = i
k.y = i
k.o = i
k.t = i
l.t = i
l.w = c
g.q = h
g.w = h
g.p = i
g.z = d
g.x = d
g.u = k
g.o = k
i.w = l
c.y = h
assert c.y.u.y.w.w.txt == "c"