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

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.p: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.q: F = None
        self.z: F = None
        self.v: G = None
        self.w: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: G = None
        self.v: G = None
        self.p: G = None
        self.r: B = None
        self.t: A = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.p: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.q: F = None
        self.z: F = None
        self.v: G = None
        self.w: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: G = None
        self.v: G = None
        self.p: G = None
        self.r: B = None
        self.t: A = None
        self.txt = txt

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

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

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