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

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: D = None
        self.p: D = None
        self.s: E = None
        self.v: A = None
        self.t: E = None
        self.z: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.s: A = None
        self.v: B = None
        self.t: C = None
        self.q: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.t: B = None
        self.z: E = None
        self.r: C = None
        self.u: A = None
        self.s: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: D = None
        self.p: D = None
        self.s: E = None
        self.v: A = None
        self.t: E = None
        self.z: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.s: A = None
        self.v: B = None
        self.t: C = None
        self.q: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.t: B = None
        self.z: E = None
        self.r: C = None
        self.u: A = None
        self.s: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

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