class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.w: B = None
        self.x: E = None
        self.v: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.z: E = None
        self.x: E = None
        self.q: G = None
        self.t: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.y: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

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

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

g.y = i
g.x = i
g.w = m
g.v = j
m.s = d
m.z = i
m.x = i
m.t = i
m.q = b
j.y = l
j.z = i
l.o = b
l.w = i
i.x = g
i.y = j
f.o = g
b.r = j
d.o = g
e.o = b
e.w = i
assert g.w.s.o.y.y.y.o.r.txt == "
class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.w: B = None
        self.x: E = None
        self.v: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.z: E = None
        self.x: E = None
        self.q: G = None
        self.t: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.y: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

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

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

g.y = i
g.x = i
g.w = m
g.v = j
m.s = d
m.z = i
m.x = i
m.t = i
m.q = b
j.y = l
j.z = i
l.o = b
l.w = i
i.x = g
i.y = j
f.o = g
b.r = j
d.o = g
e.o = b
e.w = i
assert g.w.s.o.y.y.y.o.r.txt == "j"