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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.r: D = None
        self.v: E = None
        self.w: C = None
        self.u: D = None
        self.t: C = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.r: D = None
        self.v: E = None
        self.w: C = None
        self.u: D = None
        self.t: C = None
        self.txt = txt

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

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

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