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

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

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.t: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.y: B = None
        self.q: B = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.t: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.y: B = None
        self.q: B = None
        self.txt = txt

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

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

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