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

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

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

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.x: E = None
        self.v: F = None
        self.w: E = None
        self.p: C = None
        self.u: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.s: F = None
        self.p: B = None
        self.q: B = None
        self.u: B = None
        self.x: C = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.x: E = None
        self.v: F = None
        self.w: E = None
        self.p: C = None
        self.u: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.s: F = None
        self.p: B = None
        self.q: B = None
        self.u: B = None
        self.x: C = None
        self.txt = txt

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

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

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

e.r = f
e.u = f
e.q = f
e.v = m
e.w = m
e.p = n
e.o = n
n.o = b
n.r = j
c.r = j
c.q = j
j.o = n
j.x = m
j.w = m
j.v = b
j.p = c
j.u = f
m.w = c
m.x = c
m.s = b
m.p = n
m.q = n
m.u = n
b.p = e
b.w = m
f.y = e
f.v = n
assert f.v.r.o.r.p.txt == "c"