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

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

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.p: D = None
        self.txt = txt

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

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

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

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

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

j.s = a
j.y = d
j.z = g
j.t = c
k.u = d
k.w = d
k.z = g
k.o = g
k.q = a
h.o = a
h.p = d
d.o = k
d.s = k
d.t = g
d.r = j
d.v = a
a.p = h
a.o = c
a.u = c
c.y = d
c.v = g
c.u = g
g.x = c
assert j.y.t.x.u.x.y.txt == "
class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.y: D = None
        self.z: G = None
        self.t: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.p: D = None
        self.txt = txt

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

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

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

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

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

j.s = a
j.y = d
j.z = g
j.t = c
k.u = d
k.w = d
k.z = g
k.o = g
k.q = a
h.o = a
h.p = d
d.o = k
d.s = k
d.t = g
d.r = j
d.v = a
a.p = h
a.o = c
a.u = c
c.y = d
c.v = g
c.u = g
g.x = c
assert j.y.t.x.u.x.y.txt == "d"