class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.x: B = None
        self.q: C = None
        self.s: D = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

b = A("b")
j = B("j")
a = C("a")
d = D("d")
i = E("i")
c = F("c")
k = G("k")

b.w = d
b.s = d
b.x = j
b.q = a
j.w = a
a.z = j
d.s = i
d.q = i
d.r = i
d.t = i
d.y = c
d.u = b
i.x = b
i.o = b
i.u = d
i.t = k
i.q = a
c.o = i
c.w = b
c.u = b
c.x = d
k.u = c
assert i.o.s.y.x.y.u.q.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.x: B = None
        self.q: C = None
        self.s: D = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

b = A("b")
j = B("j")
a = C("a")
d = D("d")
i = E("i")
c = F("c")
k = G("k")

b.w = d
b.s = d
b.x = j
b.q = a
j.w = a
a.z = j
d.s = i
d.q = i
d.r = i
d.t = i
d.y = c
d.u = b
i.x = b
i.o = b
i.u = d
i.t = k
i.q = a
c.o = i
c.w = b
c.u = b
c.x = d
k.u = c
assert i.o.s.y.x.y.u.q.txt == "a"