class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.v: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.s: A = None
        self.q: E = None
        self.p: E = None
        self.u: F = None
        self.v: F = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.s: A = None
        self.q: E = None
        self.p: E = None
        self.u: F = None
        self.v: F = None
        self.txt = txt

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

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

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

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

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