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

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.u: G = None
        self.p: C = None
        self.x: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.z: A = None
        self.t: B = None
        self.v: D = None
        self.x: A = None
        self.txt = txt

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

f = A("f")
d = B("d")
j = C("j")
b = D("b")
i = E("i")
e = F("e")
a = G("a")

f.x = e
d.v = e
d.u = a
d.p = j
d.x = j
j.w = i
b.x = e
b.p = i
i.z = f
i.p = a
e.y = j
e.z = f
e.x = f
e.t = d
e.v = b
a.y = b
a.u = b
a.p = b
a.x = f
a.w = i
a.q = i
a.s = i
assert a.q.p.u.x.txt == "
class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.u: G = None
        self.p: C = None
        self.x: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.z: A = None
        self.t: B = None
        self.v: D = None
        self.x: A = None
        self.txt = txt

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

f = A("f")
d = B("d")
j = C("j")
b = D("b")
i = E("i")
e = F("e")
a = G("a")

f.x = e
d.v = e
d.u = a
d.p = j
d.x = j
j.w = i
b.x = e
b.p = i
i.z = f
i.p = a
e.y = j
e.z = f
e.x = f
e.t = d
e.v = b
a.y = b
a.u = b
a.p = b
a.x = f
a.w = i
a.q = i
a.s = i
assert a.q.p.u.x.txt == "e"