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

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

class C:
    def __init__(self, txt: str):
        self.x: G = None
        self.u: F = None
        self.r: F = None
        self.t: B = None
        self.s: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.y: A = None
        self.q: C = None
        self.p: C = None
        self.txt = txt

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

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

l = A("l")
m = B("m")
f = C("f")
b = D("b")
a = E("a")
n = F("n")
d = G("d")
c = B("c")
j = G("j")

l.y = c
l.q = j
m.r = c
m.t = c
m.q = c
m.x = a
m.o = a
m.s = f
m.p = b
f.x = j
f.u = n
f.r = n
f.t = c
f.s = a
b.t = m
b.x = j
b.r = l
b.u = d
b.o = f
a.t = n
a.y = l
a.q = f
a.p = f
n.x = b
n.r = j
d.p = n
d.t = c
d.q = b
c.r = m
c.t = m
c.q = m
c.x = a
c.o = a
c.s = f
c.p = b
j.p = n
j.t = m
j.q = b
assert n.x.t.x.y.q.p.r.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.q: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: G = None
        self.u: F = None
        self.r: F = None
        self.t: B = None
        self.s: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.y: A = None
        self.q: C = None
        self.p: C = None
        self.txt = txt

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

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

l = A("l")
m = B("m")
f = C("f")
b = D("b")
a = E("a")
n = F("n")
d = G("d")
c = B("c")
j = G("j")

l.y = c
l.q = j
m.r = c
m.t = c
m.q = c
m.x = a
m.o = a
m.s = f
m.p = b
f.x = j
f.u = n
f.r = n
f.t = c
f.s = a
b.t = m
b.x = j
b.r = l
b.u = d
b.o = f
a.t = n
a.y = l
a.q = f
a.p = f
n.x = b
n.r = j
d.p = n
d.t = c
d.q = b
c.r = m
c.t = m
c.q = m
c.x = a
c.o = a
c.s = f
c.p = b
j.p = n
j.t = m
j.q = b
assert n.x.t.x.y.q.p.r.txt == "j"