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

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

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.y: E = None
        self.t: G = None
        self.z: B = None
        self.w: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.y: E = None
        self.t: G = None
        self.z: B = None
        self.w: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

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

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

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

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

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