class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.z: B = None
        self.t: D = None
        self.o: C = None
        self.x: G = None
        self.s: C = None
        self.v: G = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: A = None
        self.y: A = None
        self.o: A = None
        self.r: D = None
        self.q: E = None
        self.txt = txt

d = A("d")
i = B("i")
g = C("g")
n = D("n")
e = E("e")
l = F("l")
b = G("b")
m = F("m")

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: A = None
        self.y: A = None
        self.o: A = None
        self.r: D = None
        self.q: E = None
        self.txt = txt

d = A("d")
i = B("i")
g = C("g")
n = D("n")
e = E("e")
l = F("l")
b = G("b")
m = F("m")

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