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

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.w: B = None
        self.y: G = None
        self.u: E = None
        self.t: B = None
        self.r: D = None
        self.txt = txt

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

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

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

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

f = A("f")
i = B("i")
d = C("d")
j = D("j")
b = E("b")
k = F("k")
h = G("h")
c = E("c")

f.z = i
f.t = j
i.r = h
i.v = h
i.y = d
d.v = f
d.w = i
d.t = i
d.y = h
d.u = c
d.r = j
j.q = f
j.u = i
b.w = i
b.v = i
b.t = k
k.x = j
k.p = j
k.r = f
h.p = i
h.y = i
h.r = j
h.q = j
h.u = f
h.t = k
c.w = i
c.v = i
c.t = k
assert h.u.z.v.t.x.q.z.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.t: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.w: B = None
        self.y: G = None
        self.u: E = None
        self.t: B = None
        self.r: D = None
        self.txt = txt

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

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

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

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

f = A("f")
i = B("i")
d = C("d")
j = D("j")
b = E("b")
k = F("k")
h = G("h")
c = E("c")

f.z = i
f.t = j
i.r = h
i.v = h
i.y = d
d.v = f
d.w = i
d.t = i
d.y = h
d.u = c
d.r = j
j.q = f
j.u = i
b.w = i
b.v = i
b.t = k
k.x = j
k.p = j
k.r = f
h.p = i
h.y = i
h.r = j
h.q = j
h.u = f
h.t = k
c.w = i
c.v = i
c.t = k
assert h.u.z.v.t.x.q.z.txt == "i"