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

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

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.o: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.y: B = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.o: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.y: B = None
        self.txt = txt

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

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

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