class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: G = None
        self.x: D = None
        self.z: C = None
        self.w: E = None
        self.t: E = None
        self.q: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.v: G = None
        self.u: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: F = None
        self.u: B = None
        self.q: E = None
        self.z: E = None
        self.x: F = None
        self.w: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: G = None
        self.x: D = None
        self.z: C = None
        self.w: E = None
        self.t: E = None
        self.q: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.v: G = None
        self.u: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: F = None
        self.u: B = None
        self.q: E = None
        self.z: E = None
        self.x: F = None
        self.w: A = None
        self.txt = txt

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

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