class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.w: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.x: B = None
        self.p: B = None
        self.u: D = None
        self.r: A = None
        self.o: C = None
        self.y: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.o: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.z: F = None
        self.w: B = None
        self.s: A = None
        self.txt = txt

c = A("c")
l = B("l")
a = C("a")
g = D("g")
d = E("d")
n = F("n")
h = G("h")
b = D("b")

c.z = d
c.w = h
l.z = c
a.x = g
g.w = b
g.r = b
g.t = d
g.o = n
d.t = c
d.r = c
d.x = l
d.p = l
d.u = g
d.o = a
d.y = n
n.y = d
n.o = a
h.r = n
h.z = n
h.w = l
h.s = c
b.w = g
b.r = g
b.t = d
b.o = n
assert c.w.s.z.t.w.s.txt == "
class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.w: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.x: B = None
        self.p: B = None
        self.u: D = None
        self.r: A = None
        self.o: C = None
        self.y: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.o: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.z: F = None
        self.w: B = None
        self.s: A = None
        self.txt = txt

c = A("c")
l = B("l")
a = C("a")
g = D("g")
d = E("d")
n = F("n")
h = G("h")
b = D("b")

c.z = d
c.w = h
l.z = c
a.x = g
g.w = b
g.r = b
g.t = d
g.o = n
d.t = c
d.r = c
d.x = l
d.p = l
d.u = g
d.o = a
d.y = n
n.y = d
n.o = a
h.r = n
h.z = n
h.w = l
h.s = c
b.w = g
b.r = g
b.t = d
b.o = n
assert c.w.s.z.t.w.s.txt == "c"