class A:
    def __init__(self, txt: str):
        self.w: G = None
        self.u: F = None
        self.o: F = None
        self.y: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.t: G = None
        self.u: D = None
        self.w: E = None
        self.y: A = None
        self.q: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: E = None
        self.u: G = None
        self.t: F = None
        self.v: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.r: B = None
        self.y: E = None
        self.z: C = None
        self.o: F = None
        self.txt = txt

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

c.w = e
c.u = f
c.o = f
c.y = l
a.x = m
a.t = f
d.r = b
d.t = e
d.u = l
d.q = l
d.w = j
d.y = c
l.o = f
l.v = a
l.r = d
b.y = j
b.u = e
b.t = f
b.v = c
f.r = a
f.o = d
f.q = m
f.v = e
f.x = b
e.p = c
e.r = a
e.y = b
e.z = d
e.o = f
m.x = a
m.t = f
j.y = b
j.u = e
j.t = f
j.v = c
assert d.u.r.u.v.t.q.x.x.x.txt == "
class A:
    def __init__(self, txt: str):
        self.w: G = None
        self.u: F = None
        self.o: F = None
        self.y: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.t: G = None
        self.u: D = None
        self.w: E = None
        self.y: A = None
        self.q: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: E = None
        self.u: G = None
        self.t: F = None
        self.v: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.r: B = None
        self.y: E = None
        self.z: C = None
        self.o: F = None
        self.txt = txt

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

c.w = e
c.u = f
c.o = f
c.y = l
a.x = m
a.t = f
d.r = b
d.t = e
d.u = l
d.q = l
d.w = j
d.y = c
l.o = f
l.v = a
l.r = d
b.y = j
b.u = e
b.t = f
b.v = c
f.r = a
f.o = d
f.q = m
f.v = e
f.x = b
e.p = c
e.r = a
e.y = b
e.z = d
e.o = f
m.x = a
m.t = f
j.y = b
j.u = e
j.t = f
j.v = c
assert d.u.r.u.v.t.q.x.x.x.txt == "a"