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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.p: G = None
        self.s: F = None
        self.x: E = None
        self.r: D = None
        self.o: E = None
        self.y: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.p: D = None
        self.w: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: G = None
        self.q: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.p: G = None
        self.y: C = None
        self.u: A = None
        self.q: C = None
        self.z: C = None
        self.v: B = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.p: G = None
        self.s: F = None
        self.x: E = None
        self.r: D = None
        self.o: E = None
        self.y: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.p: D = None
        self.w: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: G = None
        self.q: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.p: G = None
        self.y: C = None
        self.u: A = None
        self.q: C = None
        self.z: C = None
        self.v: B = None
        self.txt = txt

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

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

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