class A:
    def __init__(self, txt: str):
        self.z: G = None
        self.o: C = None
        self.x: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: H = None
        self.w: B = None
        self.p: H = None
        self.s: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.s: A = None
        self.x: H = None
        self.r: G = None
        self.y: A = None
        self.o: C = None
        self.z: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.s: B = None
        self.x: B = None
        self.y: D = None
        self.q: B = None
        self.o: F = None
        self.v: H = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: H = None
        self.w: B = None
        self.p: H = None
        self.s: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.s: A = None
        self.x: H = None
        self.r: G = None
        self.y: A = None
        self.o: C = None
        self.z: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.s: B = None
        self.x: B = None
        self.y: D = None
        self.q: B = None
        self.o: F = None
        self.v: H = None
        self.txt = txt

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

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

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