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

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

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

class D:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: D = None
        self.r: D = None
        self.t: B = None
        self.z: F = None
        self.u: F = None
        self.p: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: E = None
        self.s: E = None
        self.t: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.p: E = None
        self.x: D = None
        self.y: D = None
        self.u: A = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: D = None
        self.r: D = None
        self.t: B = None
        self.z: F = None
        self.u: F = None
        self.p: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: E = None
        self.s: E = None
        self.t: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.p: E = None
        self.x: D = None
        self.y: D = None
        self.u: A = None
        self.txt = txt

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

i.x = l
i.z = d
i.r = n
j.r = n
l.s = m
l.t = j
g.q = e
g.s = e
g.r = e
g.t = j
g.z = n
g.u = n
g.p = n
m.x = f
m.s = f
m.t = i
n.s = d
n.q = d
n.y = j
d.v = j
d.p = m
d.x = e
d.y = e
d.u = i
e.q = g
e.s = g
e.r = g
e.t = j
e.z = n
e.u = n
e.p = n
f.x = m
f.s = m
f.t = i
assert e.z.y.r.txt == "n"