class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.p: F = None
        self.w: E = None
        self.v: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.q: F = None
        self.x: B = None
        self.o: A = None
        self.r: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.t: C = None
        self.r: C = None
        self.o: D = None
        self.q: D = None
        self.x: B = None
        self.txt = txt

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

e = A("e")
g = B("g")
a = C("a")
k = D("k")
h = E("h")
i = F("i")

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: F = None
        self.x: B = None
        self.o: A = None
        self.r: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.t: C = None
        self.r: C = None
        self.o: D = None
        self.q: D = None
        self.x: B = None
        self.txt = txt

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

e = A("e")
g = B("g")
a = C("a")
k = D("k")
h = E("h")
i = F("i")

e.x = h
e.w = h
e.p = i
e.v = a
g.p = i
g.u = k
a.x = k
k.q = i
k.x = g
k.r = g
k.o = e
h.z = i
h.t = a
h.r = a
h.o = k
h.q = k
h.x = g
i.w = h
i.v = g
i.p = g
i.r = k
assert i.r.q.v.txt == "g"