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

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.z: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.t: E = None
        self.p: E = None
        self.txt = txt

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

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

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

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

c.x = g
c.u = j
c.s = f
j.u = l
j.z = f
m.z = f
m.x = f
f.o = j
f.t = l
f.p = l
l.s = m
l.z = j
l.o = j
l.w = c
l.x = g
l.v = f
b.y = m
d.r = e
d.x = e
d.o = c
e.r = d
e.o = c
e.x = i
i.r = d
i.x = d
i.o = c
g.y = m
assert f.o.u.z.u.w.txt == "
class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.u: B = None
        self.s: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.z: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.t: E = None
        self.p: E = None
        self.txt = txt

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

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

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

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

c.x = g
c.u = j
c.s = f
j.u = l
j.z = f
m.z = f
m.x = f
f.o = j
f.t = l
f.p = l
l.s = m
l.z = j
l.o = j
l.w = c
l.x = g
l.v = f
b.y = m
d.r = e
d.x = e
d.o = c
e.r = d
e.o = c
e.x = i
i.r = d
i.x = d
i.o = c
g.y = m
assert f.o.u.z.u.w.txt == "c"