class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.q: F = None
        self.u: C = None
        self.v: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

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

d.o = c
d.q = l
d.u = a
d.v = a
g.w = f
g.u = n
g.r = m
g.s = m
g.t = d
a.r = m
a.v = f
a.p = l
m.u = f
m.t = c
m.o = d
m.p = d
m.w = n
c.u = d
l.r = m
l.x = m
l.v = m
l.q = a
l.o = g
l.y = g
l.w = c
f.w = m
n.w = f
n.u = g
n.r = m
n.s = m
n.t = d
assert l.q.r.t.txt == "
class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.q: F = None
        self.u: C = None
        self.v: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

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

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